<%--
  Created by IntelliJ IDEA.
  User: zarra
  Date: 15/10/29
  Time: 上午9:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<html>
<head>
    <%--<c:url value="/j_spring_security_check" var="login"></c:url>--%>
    <c:url value="/login" var="login"></c:url>
    <title>Login</title>
    <script src="<c:url value="${webJarRoot}webjar.js"/>" type="text/javascript"></script>

    <link href="<c:url value="${webJarRoot}bootstrap/css/bootstrap.css"/>" rel="stylesheet" type="text/css"/>
    <link href="<c:url value="${webJarRoot}bootstrap/css/bootstrap-theme.min.css"/>" rel="stylesheet" type="text/css"/>
    <link href="<c:url value="${webJarRoot}font-awesome/css/font-awesome.css"/>" rel="stylesheet" type="text/css"/>
    <script src="<c:url value="${webJarRoot}jquery/jquery.min.js"/>" type="text/javascript"></script>
    <script src="<c:url value="${webJarRoot}bootstrap/js/bootstrap.min.js"/>" type="text/javascript"></script>
    <style>

    </style>
</head>
<body>
<div class="container" style="vertical-align: middle;">
    <div class="panel panel-primary center-block " style="width: 500px;">

        <div class="panel-heading">
            <h2>Login</h2>
        </div>
        <div class="panel-body">
            <form class="form-horizontal" role="form" action="${login}" method="post">
                <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
                <div class="form-group">
                    <label class="control-label col-sm-2" for="username">Username:</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="username" name="username"
                               placeholder="Please input your username">
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-sm-2" for="pwd">Password:</label>

                    <div class="col-sm-10">
                        <input type="password" class="form-control" id="pwd" name="password"
                               placeholder="Please input your password">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <div class="checkbox">
                            <label><input type="checkbox" name="_spring_security_remember_me">Keep login?</label>
                        </div>
                    </div>
                </div>
                <c:if test="${param.error != null}">
                    <div class="form-group">
                        <p>错误:${param.error.toString()}</p>
                    </div>
                </c:if>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary"><i class="fa fa-sign-in fa-fw"></i>Login</button>
                    </div>
                </div>
            </form>
        </div>

    </div>
</div>
</body>
</html>
